# 1.导入库
import pymysql

# 2.建立连接
conn = pymysql.connect(
    host="mysql.hogwarts.ceshiren.com",
    port=3306,
    user="stu",
    password="hogwarts_stu",
    database="hogwarts_stu",
    charset="utf8mb4"
)
# 3.关闭连接
conn.close()
